package com.ruoyi.platform.system.role.pojo;

import com.ruoyi.platform.system.role.enums.RoleEnum;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 用户角色表
 *
 * @author lcf
 * @since 2021-08-13 03:36:41
 */
@Data
@NoArgsConstructor
public class UserRoleDO {
    /**
     * id
     */
    private Long id;

    /**
     * 用户id
     */
    private Long userId;
    /**
     * 角色code
     */
    private Integer roleCode;

    /**
     * 新增
     */
    public UserRoleDO(long userId, RoleEnum roleEnum) {
        this.userId = userId;
        this.roleCode = roleEnum.getCode();
    }
}
